package com.tong.calculator.annotation.valid;

/**
 * 使用枚举作为限定条件的校验注解
 * @author lv
 * @version 1.0.0
 */

import com.tong.calculator.valid.EnumCheckValidator;
import com.tong.calculator.valid.EnumValid;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = EnumCheckValidator.class)
public @interface EnumCheck {

    String message() default "参数不在限制范围";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };

    Class<? extends Enum<? extends EnumValid>> enumClass();
}
